package com.eurabia.eggchat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.eurabia.eggchat.pojo.SysEggchatUser;
import com.eurabia.eggchat.pojo.form.SysEggchatUserForm;
import com.eurabia.eggchat.pojo.query.SysEggchatUserQuery;
import com.eurabia.eggchat.dao.SysEggchatUserDao;
import com.eurabia.eggchat.service.SysEggchatUserService;

import javax.annotation.Resource;


/**
 * SysEggchatUserService 
 */
@Service
public class SysEggchatUserServiceImpl implements SysEggchatUserService {
    @Resource
    private SysEggchatUserDao sysEggchatUserDao;
	
	/**
     * 查询 SysEggchatUser
     */
    @Override
    public List<SysEggchatUser> find(final SysEggchatUserQuery query) {
        return sysEggchatUserDao.find(query);
    }
    
    /**
     * 分页查询 SysEggchatUser
     */
    @Override
    public Page<SysEggchatUser> findByPage(final SysEggchatUserQuery query) {
        PageHelper.startPage(query.getPage().intValue(), query.getLimit().intValue());
        return (Page<SysEggchatUser>) sysEggchatUserDao.find(query);
    }

    /**
     * 通过id得到一个 SysEggchatUser
     */
    @Override
    public SysEggchatUser get(final String id) {
        return sysEggchatUserDao.get(id);
    }
    
    /**
     * 新增 SysEggchatUser
     */
    @Override
    public void add(final SysEggchatUserForm form) {
        sysEggchatUserDao.add(form);
    }

    /**
     * 修改 SysEggchatUser
     */
    @Override
    public int update(final SysEggchatUserForm form) {
        return sysEggchatUserDao.update(form);
    }
    
    /**
     * 删除一个 SysEggchatUser
     */
    @Override
    public int delete(final String id) {
        return sysEggchatUserDao.delete(id);
    }
	
	/**
     * 修改是否可用
     */
    @Override
    public int changeEnabled(final String id, final Integer enabled) {
        return sysEggchatUserDao.changeEnabled(id, enabled);
    }
}